package com.rui.study.demo.httpclient.cncbox;

import com.rui.study.demo.httpclient.HttpClient;
import com.rui.study.demo.httpclient.util.JsonUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2018-11-22 09:59
 **/
public class UserSelf {

    private static void loadUserAccount(String identifier) {
        String url = "http://172.16.2.140:11000/userself/v1/user-account/" + identifier;
        HttpClient.get(url);
    }

    private static void thirdBindEmail(String json) {
        String url = "http://172.16.2.140:11000/userself/v1/account/third-bind-email";
        HttpClient.postJson(url, json);
    }

    public static void main(String[] args) {
//        loadUserAccount("yaowr@mpreader.com");
        Map<String, String> params = new HashMap<>();
        params.put("accountId", "15396560059727295");
//        params.put("email", "yao777@mpreader.com");
        params.put("email", "yaowr@mpreader.com");
        params.put("thirdAuthType", "WEIXIN");
        params.put("verifyCode", "000000");
        params.put("password", "DC483E80A7A0BD9EF71D8CF973673924");

        thirdBindEmail(JsonUtil.toJson(params));
    }
}
